#include "SMPPDestSubaddress.hpp"

using namespace smpp::pdu;

DestSubaddress::DestSubaddress(const octetString &nValue):
TLV(TLVtags::TAG_DEST_ADDR_NP_INFORMATION,nValue.size()),_Value(nValue){}

DestSubaddress::DestSubaddress(const DestSubaddress &nDestSubaddress):
TLV(nDestSubaddress),_Value(nDestSubaddress.getValue()){}

bool DestSubaddress::operator ==(
	const DestSubaddress &nDestSubaddress) const{
	return (TLV::operator == (nDestSubaddress) && 
			_Value == nDestSubaddress.getValue());
}

bool DestSubaddress::operator !=(
	const DestSubaddress &nDestSubaddress) const{
	return !this->operator == (nDestSubaddress);
}

DestSubaddress &DestSubaddress::operator = (
	const DestSubaddress &nDestSubaddress){
	if(*this == nDestSubaddress)
		return *this;
	TLV::operator = (nDestSubaddress);
	_Value = nDestSubaddress.getValue();
	return *this;
}

void DestSubaddress::setValue(const octetString &nValue){
	_Value = nValue;
}

const octetString &DestSubaddress::getValue() const{
	return _Value;
}
